<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Using the PHP LDAP calls</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="ldap.constants.html">« 预定义常量</a></li>
      <li style="float: right;"><a href="ldap.controls.html">LDAP controls »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.ldap.html">LDAP</a></li>
    <li>Using the PHP LDAP calls</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="ldap.using" class="chapter">
 <h1>Using the PHP LDAP calls</h1>

 <p class="para">
  Before you can use the LDAP calls you will need to know...
  <ul class="itemizedlist">
   <li class="listitem">
    <p class="para">
     The name or address of the directory server you will use
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     The &quot;base dn&quot; of the server (the part of the world directory
     that is held on this server, which could be &quot;o=My
     Company,c=US&quot;)
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     Whether you need a password to access the server (many servers
     will provide read access for an &quot;anonymous bind&quot; but require a
     password for anything else)
    </p>
   </li>
  </ul>
 </p>

 <p class="para">
  The typical sequence of LDAP calls you will make in an
  application will follow this pattern:
<pre class="literallayout">
  ldap_connect()    // establish connection to server
     |
  ldap_bind()       // anonymous or authenticated &quot;login&quot;
     |
  do something like search or update the directory
  and display the results
     |
  ldap_close()      // &quot;logout&quot;
</pre>
 </p>
</div>
</div></div></body></html>